home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / gfx_card / pap12pat.lha / PAP12patch.rexx < prev    next >
OS/2 REXX Batch file  |  1994-09-26  |  4KB  |  166 lines

  1. /* Update Part And Particle v1.1 to v1.2 */
  2. /*                                       */
  3. /*          ©1994 Carmen Rizzolo         */
  4. /*                                       */
  5.  
  6. Options Results
  7. Address Command
  8. Quote = "'"
  9.  
  10. Say
  11. Say
  12.  
  13. If Exists('OpalPaint:Rexx/PAP11.oprx') = 0 Then Do
  14.     Say 'I cannot seem to find the Part And Particle v1.1 file!'
  15.     Say 'Perhaps you need to first upgrade from 1.0 to 1.1'
  16.     If Exists('Rexx:PAP11.oprx') = 0 Then Do
  17.         Say 'Nope.  Definently not there.  Exiting...'
  18.         Exit
  19.         End
  20.     End
  21.  
  22. If Exists('OpalPaint:Rexx/PAP11.oprx') = 1 Then Say 'PAP11.oprx found in OpalPaint:Rexx/'
  23. If Exists('Rexx:PAP11.oprx') = 1 & Exists('OpalPaint:Rexx/PAP11.oprx') = 0 Then Say 'Okay, there it is... In Rexx:'
  24.  
  25. If Exists('OpalPaint:Rexx/PAP11.oprx') = 1 Then PAPDir = 'OpalPaint:Rexx/'
  26. Else If Exists('Rexx:PAP11.oprx') = 1 Then PAPDir = 'Rexx:'
  27.  
  28. Say
  29. Say
  30. Say 'WARNING!  Your PAP11.oprx file MUST be the original, unmodified file'
  31. Say 'that came from your PAP installation, or unmodified from the upgrade'
  32. Say 'patch that brought you from 1.0 to 1.1.  Shall I continue? (y/n)'
  33. Pull YesNo
  34.  
  35. If UPPER(Left(YesNo,1)) ~= 'Y' Then Do
  36.     Say
  37.     Say 'Operation aborted.. Have a nice day.'
  38.     Exit
  39.     End
  40.  
  41. Say
  42. Say
  43. Say 'Stand By: Upgrading...'
  44.  
  45. 'Copy ' || PAPDir || 'PAP11.oprx Ram: Quiet'
  46.  
  47. Call Open('PAP11File','Ram:PAP11.oprx','r')
  48.  
  49. Do A = 1 to 350
  50.     AA = ReadLn('PAP11File')
  51.     End
  52.  
  53. If Right(AA,25) ~= '"Part And Particle v1.1"' || Quote Then Do
  54.     Say 'FATAL ERROR!  It appears that this is NOT Part And Particle'
  55.     Say 'version 1.1!  Either that or the file has been modified.'
  56.     Say 'Please re-install Part And Particle from the original disks'
  57.     Say 'before trying this script again.  Exiting...'
  58.     Exit
  59.     End
  60.  
  61. Call Close('PAP11File')
  62.  
  63. Call Open('PAP11File','Ram:PAP11.oprx','r')
  64. Call Open('PAP12File','Ram:PAP12.oprx','w')
  65.  
  66. Call WriteLn('PAP12File','/*                        */')
  67. Call WriteLn('PAP12File','/* Part and Particle v1.2 */')
  68.  
  69. Do A = 1 to 2
  70.     AA = ReadLn('PAP11File')
  71.     End
  72.  
  73. Do A = 1 to 347
  74.     AA = ReadLn('PAP11File')
  75.     Call WriteLn('PAP12File',AA)
  76.     End
  77.  
  78. AA = ReadLn('PAP11File')
  79. NewLine = '      AddHeading ' || Quote || 'CenterX 20 "Part And Particle v1.2"' || Quote
  80. Call WriteLn('PAP12File',NewLine)
  81.  
  82. Do A = 1 to 1606
  83.     AA = ReadLn('PAP11File')
  84.     Call WriteLn('PAP12File',AA)
  85.     End
  86.  
  87. NewLine = '    Do ProjNum = 1 to 21'
  88. Call WriteLn('PAP12File',NewLine)
  89. AA = ReadLn('PAP11File')
  90.  
  91. Do A = 1 to 39
  92.     AA = ReadLn('PAP11File')
  93.     Call WriteLn('PAP12File',AA)
  94.     End
  95.  
  96. NewLine = '        If ProjectCount > 20 then Do'
  97. Call WriteLn('PAP12File',NewLine)
  98. AA = ReadLn('PAP11File')
  99.  
  100. Do A = 1 to 6
  101.     AA = ReadLn('PAP11File')
  102.     Call WriteLn('PAP12File',AA)
  103.     End
  104.  
  105. NewLine = '        Do P = 1 to ProjectCount'
  106. Call WriteLn('PAP12File',NewLine)
  107. AA = ReadLn('PAP11File')
  108.  
  109. Do A = 1 to 27
  110.     AA = ReadLn('PAP11File')
  111.     Call WriteLn('PAP12File',AA)
  112.     End
  113.  
  114. NewLine = '        Do P = 1 to ProjectCount'
  115. Call WriteLn('PAP12File',NewLine)
  116.  
  117. AA = ReadLn('PAP11File')
  118. Do A = 1 to 63
  119.     AA = ReadLn('PAP11File')
  120.     Call WriteLn('PAP12File',AA)
  121.     End
  122.  
  123. NewLine = '        If ProjNum = 21 Then Do'
  124. Call WriteLn('PAP12File',NewLine)
  125. NewLine = '            Okay ' || Quote || 'This was the 20th Project.  Time to move on.' || Quote
  126. Call WriteLn('PAP12File',NewLine)
  127. NewLine = '            TotalProjects = 20'
  128. Call WriteLn('PAP12File',NewLine)
  129.  
  130. Do A = 1 to 3
  131.     AA = ReadLn('PAP11File')
  132.     End
  133.  
  134. Do A = 1 to 57
  135.     AA = ReadLn('PAP11File')
  136.     Call WriteLn('PAP12File',AA)
  137.     End
  138.  
  139. NewLine = '    Return TotalProjects Proj.1 Proj.2 Proj.3 Proj.4 Proj.5 Proj.6 Proj.7 Proj.7 Proj.8 Proj.9 Proj.10 Proj.11 Proj.12 Proj.13 Proj.14 Proj.15 Proj.16 Proj.17 Proj.18 Proj.19. Proj.20'
  140. Call WriteLn('PAP12File',NewLine)
  141. AA = ReadLn('PAP11File')
  142.  
  143. Do A = 1 to 2018
  144.     AA = ReadLn('PAP11File')
  145.     Call WriteLn('PAP12File',AA)
  146.     End
  147.  
  148. Call Close('PAP11File')
  149. Call Close('PAP12File')
  150.  
  151. Say '...done'
  152.  
  153. If Exists('OpalPaint:Rexx/') = 1 Then 'Copy Ram:PAP12.oprx ' || PAPDir || ' QUIET'
  154.  
  155. Delete 'Ram:PAP11.oprx Quiet'
  156. Delete 'Ram:PAP12.oprx Quiet'
  157.  
  158. Say
  159. Say 'Operation complete!'
  160. Say 'PAP12.oprx (Part And Particle v1.2) is now in your'
  161. Say PAPDir || ' directory.'
  162. Say
  163. Say 'Exiting...'
  164.  
  165. Exit
  166.